#!/usr/bin/python
# -*- coding: utf-8 -*-

import Ice, sys
import SpammerFactoryI
from SpammerFactoryI import *

class SpammerFactoryServer (Ice.Application):

    def run (self, argv):
        self.shutdownOnInterrupt()
        adapter = self.communicator().createObjectAdapter('SpammerFactoryAdapter')
        adapter.activate()

        props = self.communicator().getProperties()
        objId = 'SpammerFactory.' + str(props.getProperty('number'))

        adapter.add(SpammerFactoryI(),
                    self.communicator().stringToIdentity(objId))
        self.communicator().waitForShutdown()

        return 0

SpammerFactoryServer().main(sys.argv)
